﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>营改增补助数据导入</title>
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
 <script src="@Url.Content("~/Scripts/checkinput.js")" type="text/javascript"></script>
    <style>
        input.txt,textarea{ width:90%; border:1px solid #aecaf0;}
        input.txt:focus,textarea:focus{border-color:#6e90be;}
        input.btn{ width:100px;}
        .readonly{ background:#ccc;}
        /**/.hid{ display:none;}
        th{ text-align:right;}        
a:link,a:visited {text-decoration:none;color:#1E5B8A;}
a:hover,a:active {text-decoration:underline;color: #FF5500;}
    </style>
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script type="text/javascript">

        var rootUrl = '@Url.Content("~/YGZAllowance/")';

        function check() {

            var year = $('#year').val();
            if (isEmpty(year)) {
                alert('请输入年份！');
                return false;
            }

            if (!isNumeric(year)) {
                alert('请正确输入年份！');
                return false;
            }
            if (year * 1 < 1000 || year * 1 > 9999) {
                alert('请正确输入年份！');
                return false;
            }

            var period = $('#period').val();
            if (isEmpty(period)) {
                alert('请输入编号！');
                return false;
            }

            if (!isNumeric(period)) {
                alert('请正确输入编号！');
                return false;
            }
            if (period * 1 == 0) {
                alert('期号不能为零！');
                return false;
            }

            if (upload.GetText() == "") {
                alert("请选择要上传的文件！");
                return false;
            }
            return true;
        }

        function OK() {
            if (check()) {
                form1.submit();
           }
        }


    </script>



</head>
<body>

    @using (Html.BeginForm("YGZAllowanceImport", "YGZAllowance", FormMethod.Post, new { id = "form1" }))
    {        
         <table cellpadding="3"><tr>
        <td width="50" style=" text-align:right">年度:</td>
        <td  width="365">
            <input id="year" name="year" value="@EnterpriseFund.Common.OperateSession.get(EnterpriseFund.Common.GlobalConstant.PARAM_SYSYEAR)" style=" width:365px" class="txt" maxlength="4"  />
        </td>
        <td></td>
    </tr>
    <tr>
        <td width="50" style=" text-align:right">编号:</td>
        <td  width="365"><input id="period" name="period" style=" width:365px" value="" class="txt" type="text" maxlength="3"   /></td>
        <td> <font Color="red" > 注：必须输入数字</font></td>
    </tr>
            <tr>
            <td style=" text-align:right">文件:</td>
            <td  width="365">@Html.DevExpress().UploadControl(
            settings =>
            {
                settings.Name = "upload";
                settings.BrowseButton.Text = "浏览";
                settings.Width = System.Web.UI.WebControls.Unit.Pixel(370);
                settings.ClearFileSelectionImage.ToolTip = "清除选择";
                settings.ShowProgressPanel = true;
                settings.ValidationSettings.MaxFileSize = 20971520;                           
                settings.ShowUploadButton = false;
            }).GetHtml()</td>
            <td style=" text-align:left"><a href="@Url.Content("~/DataTemplate/营改增补助导入模板.xls")">模板下载</a></td>
       </tr>
           @* <tr>
                <th></th>
                <td align="right" ><a href="@Url.Content("~/DataTemplate/营改增补助导入模板.xls")">营改增补助导入模板文件下载</a></td>
            </tr>*@
            <tr>
                <th></th>
                <td >
 @Html.DevExpress().CheckBox(
                        settings =>
                        {
                            settings.Name = "isDelData";
                            settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
                            settings.Text = "删除原有数据";
                            settings.Checked = true;
                        }).GetHtml()
            </td>
                <td></td>
            </tr>
        </table>
            
    }

</body>
</html>
<script>
    lp.Hide();

    if (parent.pop) {
        parent.pop.SetHeaderText("营改增补助信息导入");
    }

    var msg = '@ViewBag.Msg';
    if (msg) {
        if (msg == 'ok') {
            alert("导入成功！");
            parent.Cancel();
            parent.gvEditing.Refresh();
        }
        else {
            alert(msg);
        }
    }
</script>
